﻿#include"StashManageControllerObject.h"
#include<QMessageBox>
StashManageControllerObject::StashManageControllerObject(QObject* parent)
	:QObject(parent)
{
	connect(this, &StashManageControllerObject::sendMessageBoxInfoSignals,this,&StashManageControllerObject::messageBoxInfo,Qt::QueuedConnection);
}

StashManageControllerObject::~StashManageControllerObject()
{
	if(m_model)
	{
		/*qDebug() << "释放模型中";*/
		delete m_model;
		m_model = nullptr;
	}
}

StashManageModelObject* StashManageControllerObject::model() const
{
	return m_model;
}

void StashManageControllerObject::setModel(StashManageModelObject* model)
{
	m_model = model;
}

void StashManageControllerObject::copyModel(StashManageModelObject* model)
{
	if (model == nullptr || m_model == nullptr)
		return;
	*m_model = *model;
}

void StashManageControllerObject::messageBoxInfo(const QString& title, const QString& text)
{
	QMessageBox::information(nullptr,title,text);
}
